package com.leetcode.LC;

import java.util.Arrays;

public class LC744 {
    public char nextGreatestLetter(char[] letters, char target) {//可以改为二分搜索提高效率

        Arrays.sort(letters);
        for (char letter : letters) {
            if (letter>target){
                return letter;
            }
        }
        return letters[0];
    }

    public static void main(String[] args) {
        System.out.println(new LC744().nextGreatestLetter(new char[]{'c', 'f'}, 'f'));
    }
}
